This page last changed on Oct 26, 2008 by scytacki.

This a bug on OSX 10.4 with Java 1.5.0_16:

java version "1.5.0_16"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16-b06-275)
Java HotSpot(TM) Client VM (build 1.5.0_16-132, mixed mode, sharing)

When a jnlp file uses installer extensions in this environment the following error occurs:

Exception in thread "javawsApplicationMain" java.lang.NullPointerException
at java.lang.ProcessBuilder.start(ProcessBuilder.java:441)
at java.lang.Runtime.exec(Runtime.java:591)
at java.lang.Runtime.exec(Runtime.java:464)
at com.sun.javaws.Launcher.execProgram(Launcher.java:817)
at com.sun.javaws.Launcher.executeInstallers(Launcher.java:670)
at com.sun.javaws.Launcher.handleApplicationDesc(Launcher.java:438)
at com.sun.javaws.Launcher.handleLaunchFile(Launcher.java:218)
at com.sun.javaws.Launcher.run(Launcher.java:165)
at java.lang.Thread.run(Thread.java:613)

Here is a jnlp to test this: http://jnlp.concord.org/dev/mozswing2/mozswing.jnlp

This problem can be fixed by patching the deploy.jar with this script:

cd /tmp ; curl http://confluence.concord.org/download/attachments/10877/deploy-1.5.0_16-fix.jar > deploy-1.5.0_16-fix.jar ; unzip deploy-1.5.0_16-fix.jar ; sudo zip -u "/System/Library/Frameworks/JavaVM.framework/Home/lib/deploy.jar" com/sun/deploy/config/MacOSXConfig.class ; rm com/sun/deploy/config/MacOSXConfig.class deploy-1.5.0_16-fix.jar ; cd -

32bit Macs running OSX 10.5 also use Java 1.5.0_16, but they don't have this bug. They report their java version as:

1.5.0 (32-bit):
java version "1.5.0_16"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16-b06-284)
Java HotSpot(TM) Client VM (build 1.5.0_16-133, mixed mode, sharing)

An alternative fix to the one above might be to copy the deploy.jar from a 10.5 mac to a 10.4 one. This hasn't been tested but I think it will work.

More details on the fix

The fix above was created by decompiling deploy.jar and javaws.jar. The problem was tracked down to the following piece of code:

com.sun.deploy.config.Config:
  public String escapeBackslashAndQuoteString(String in)
  {
     return null;
  } 

This Config class is subclassed by a MacOSXConfig class:

  • in OSX 10.4 java 1.5.0_16 MacOSXConfig does not override the escapeBackslashAndQuoteString method.
  • in OSX 10.5 java 1.5.0_16 MacOSXConfig overrides the escapeBackslashAndQuoteString method to just return the passed in string.

My fix above updates the MacOSXConfig class to override this method and return the passed in string.

Thanks Scott. This came in handy today.

Posted by hiroki at Dec 10, 2008 18:34
Document generated by Confluence on Jan 27, 2014 16:56